package com.tutu.commons.feign;

import com.tutu.commons.entity.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Program: SpringCloudAlibaba
 * @Description:
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-12-03 22:41
 **/
@FeignClient(value = "bookserver")
public interface BookClient {

    @GetMapping("/book/{bid}")
    Book findBookById(@PathVariable("bid") int bid);

    /**
     * 根据bid获取当前图书数量
     */
    @GetMapping("/book/getBookNum/{bid}")
    int getBookNum(@PathVariable("bid") int bid);

    /**
     * 图书借阅
     */
    @GetMapping("/book/bookBorrow/{bid}")
    boolean bookBorrow(@PathVariable("bid") int bid);
}